// SKU管理模块接口
import request from '@/utils/request'

enum API {
  // 查询SKU列表接口
  SKU_LIST_URL = '/admin/product/list/',
  // 删除SKU接口
  SKU_DELETE_URL = '/admin/product/deleteSku/',
  //   下架SKU接口
  CANCELSALE_SKU_URL = '/admin/product/cancelSale/',
  // 上架SKU接口
  SALE_SKU_URL = '/admin/product/onSale/',
  //   查询SKU详情接口
  QUERY_SKUINFO_URL = '/admin/product/getSkuInfo/'
}

// 获取列表数据方法
export const reqSKuList = (page: any, limit: any) => {
  return request.get<any, any>(API.SKU_LIST_URL + `${page}/${limit}`)
}

// 上架SKU方法
export const saleSku = (skuId: any) => {
  return request.get<any, any>(API.SALE_SKU_URL + skuId)
}

//   下架SKU方法
export const cancelSaleSku = (skuId: any) => {
  return request.get<any, any>(API.CANCELSALE_SKU_URL + skuId)
}

//   查询SKU方法
export const reqSkuInfo = (skuId: any) => {
  return request.get<any, any>(API.QUERY_SKUINFO_URL + skuId)
}

// 删除SKU方法
export const delSkuReq = (id: any) => {
  return request.delete<any, any>(API.SKU_DELETE_URL + id)
}
